#!/bin/bash

pattern="$1"
replacement="$2"
shift 2;
if [ ! -z "${pattern}${replacement}" ]
then
  # input="$(cat)"
  # x="$(echo "$input" | perl -p -e "s/$pattern/$replacement/g")"
  cat | resub --no-verbose -m "$pattern" "$replacement" | exec replace2 "$@"
else
  exec cat
fi


